package com.example.studyktdemo.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider

abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {

    lateinit var binding:T
    /*lateinit var viewModel:M*/

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding = DataBindingUtil.setContentView(this,getLayoutId())
        //viewModel = ViewModelProvider(this,ViewModelProvider.NewInstanceFactory()).get(viewModel::class.java)
        initView()
    }

    abstract fun initView()

    abstract fun getLayoutId(): Int
}